package org.seckill.dto;

import org.seckill.entity.SuccessKilled;
import org.seckill.enums.SeckillStateEnum;

/**
 * 封装秒杀执行后的结果
 * Created by qqz on 2018/5/12.
 */
public class SeckillExecution
{
    private long seckillId;

    //秒杀结果状态
    private int state;

    private String stateInfo;

    private SuccessKilled successKilled;

    public SeckillExecution(long seckillId, SeckillStateEnum stateEnum, SuccessKilled successKilled)
    {
        this.seckillId = seckillId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.successKilled = successKilled;
    }

    public SeckillExecution(long seckillId, SeckillStateEnum stateEnum)
    {
        this.seckillId = seckillId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    public long getSeckillId()
    {
        return seckillId;
    }

    public void setSeckillId(long seckillId)
    {
        this.seckillId = seckillId;
    }

    public int getState()
    {
        return state;
    }

    public void setState(int state)
    {
        this.state = state;
    }

    public String getStateInfo()
    {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo)
    {
        this.stateInfo = stateInfo;
    }

    public SuccessKilled getSuccessKilled()
    {
        return successKilled;
    }

    public void setSuccessKilled(SuccessKilled successKilled)
    {
        this.successKilled = successKilled;
    }
}
